/**
 * 
 */
package com.feib.stms.dao.jdbc;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author Jimmy Liu
 *
 */
public class SqlQueryProvider implements Serializable
{
	private static final long serialVersionUID = 5168288209310782024L;
	
	private String sql;
    
    private List<Object> argList;

    public SqlQueryProvider(String sql, List<Object> argList)
    {
        this.sql = sql;
        this.argList = argList;
    }
    
    public List<Object> getArgList()
    {
        return argList;
    }

    public void setArgList(List<Object> argList)
    {
        this.argList = argList;
    }
    
    public  Object[] getArgs()
    {
        if (null == this.argList)
            return new Object[]{};
        return this.argList.toArray();
    }

    public String getSql()
    {
        return sql;
    }

    public void setSql(String sql)
    {
        this.sql = sql;
    }
    
    @Override
    public String toString()
    {
        return new ToStringBuilder(this).append("sql", sql).append("argList",
                argList).toString();
    }
}
